package myWebApp;

/*第三章 垃圾收集器
 *测试需要知识点:
 *新生代/老年代
 *Eden/Survivor
 *参数设置:
 *-Xmn 新生代大小
 *-XX:SurvivorRatio Eden区对Survivor区的比例
 *
 *jvm参数:-verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:+UseSerialGC
 *2017年8月4日19:45:48
 */
public class GC3 {
	
	private static final int _1M = 1024*1024; 
	
	public static void main(String[] args) {
		/*申请2*3M,然后再申请4M,启动参数为:
		 * -verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:+UseSerialGC
		 */
		byte[] TB1,TB2,TB3,TB4;
		TB1 = new byte[2 * _1M];
		TB2 = new byte[2 * _1M];
		TB3 = new byte[2 * _1M];
		TB4 = new byte[4 * _1M];
	}
	
}

/*信息如下:
 * [GC (Allocation Failure) [DefNew: 7291K->595K(9216K), 0.0032819 secs] 7291K->6739K(19456K), 0.0033186 secs] [Times: user=0.00 sys=0.02, real=0.00 secs] 
	Heap
	 def new generation   total 9216K, used 4773K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000)
	  eden space 8192K,  51% used [0x00000000fec00000, 0x00000000ff014930, 0x00000000ff400000)
	  from space 1024K,  58% used [0x00000000ff500000, 0x00000000ff594e50, 0x00000000ff600000)
	  to   space 1024K,   0% used [0x00000000ff400000, 0x00000000ff400000, 0x00000000ff500000)
	 tenured generation   total 10240K, used 6144K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)
	   the space 10240K,  60% used [0x00000000ff600000, 0x00000000ffc00030, 0x00000000ffc00200, 0x0000000100000000)
	 Metaspace       used 2544K, capacity 4486K, committed 4864K, reserved 1056768K
	  class space    used 271K, capacity 386K, committed 512K, reserved 1048576K
 */
 